# 启动服务器的简化脚本
import sys
import os

# 添加当前目录到Python路径
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

try:
    from app.main import app
    import uvicorn
    
    print("Starting server...")
    print("Open http://localhost:8000 in your browser")
    print("Press CTRL+C to stop the server")
    
    # 启动服务器
    uvicorn.run("app.main:app", host="0.0.0.0", port=8000, reload=True)
    
except ImportError as e:
    print(f"Import error: {e}")
    print("Please make sure all dependencies are installed:")
    print("pip install fastapi uvicorn sqlalchemy pydantic python-jose passlib python-multipart")
    
except Exception as e:
    print(f"Error starting server: {e}")